package com;

/**
 * Created by angrycans on 15/7/7.
 */


import com.Util.DB;
import com.exception.JerseyException;
import org.glassfish.jersey.server.ResourceConfig;
import org.slf4j.*;

import javax.inject.Inject;
import javax.servlet.annotation.WebServlet;
import javax.ws.rs.ApplicationPath;
import java.util.Properties;


@WebServlet(loadOnStartup = 1)
@ApplicationPath("/api/*")
public class JerseyConfig extends ResourceConfig {
    private final Logger log = LoggerFactory.getLogger(getClass());

    public JerseyConfig() {

        packages("com.controller");
        Properties props = System.getProperties();
        log.debug("Current working directory is " + props.getProperty("user.dir"));
        log.info("Current working directory is " + props.getProperty("user.dir"));
        log.info("Registering injectables...");
        //注册类
        register ( RequestFilter.class );
        register(ResponseFilter.class);
        register ( ServerListener.class );
        //register ( JerseyException.class );

    }
}